package memorphic.samplr.views.itemRenderers
{
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import memorphic.samplr.events.PhotoEvent;
	import memorphic.samplr.models.SamplrPhoto;
	
	import mx.controls.CheckBox;
	import mx.controls.Image;
	
	public class ViewTileRenderer extends Image
	{
		public var photo:SamplrPhoto;
		
		public function ViewTileRenderer()
		{
			super();
			width = 100;
			height = 100;
			maintainAspectRatio = true;
			cacheAsBitmap = true;
		}
		
		protected override function createChildren():void
		{
			super.createChildren();
		}
		
		protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
		}
		
		protected override function commitProperties():void
		{
			super.commitProperties();
		}
		
		public override function set data(value:Object):void
		{
			if (photo != value)
			{
				photo = SamplrPhoto(value);
				super.data = value;
				source = photo.sourceThumbnail ? photo.sourceThumbnail : photo.flickrURLThumbnail;
			}
		}
	}
}